package com.doit.day06

import scala.collection.mutable.ArrayBuffer

object _02_比较算子 {
  def main(args: Array[String]): Unit = {
    val list = List(
      (1, "a", 18),
      (2, "b", 28),
      (4, "d", 58),
      (4, "u", 38),
      (6, "z", 68),
      (5, "x", 88)
    )

    //按照老王对象的id进行降序排列
    //list.sortBy(-_.id)

    //按照元祖的升序排列，id相同的话比较name升序，name也相同比较age升序
//    list.sortWith((tp1,tp2)=>{
//      val id1: Int = tp1._1
//      val id2: Int = tp2._1
//    })
    println(list.sorted)


    val ints: ArrayBuffer[Int] = new ArrayBuffer[Int]()
    ints.append(1,2,3)
    ints.update(0,10)
    ints.remove(1,2)


  }
}
